CXX = g++
CXXFLAGS = -Wall -Wextra -Weffc++ -std=c++98 -O2
CXXLDFLAGS = -lglut -lGLU -lGL

OBJECTS = $(patsubst src/%.cpp, obj/%.o, $(wildcard src/*.cpp src/objects/*.cpp))
TARGET = angryball

all : $(TARGET)

$(TARGET): $(OBJECTS)
	$(CXX) $(CXXFLAGS) $(OBJECTS) -o $(TARGET) $(CXXLDFLAGS)

obj/%.o: src/%.cpp dirs
	$(CXX) -c $(CXXFLAGS) -o $@ $<

clean :
	rm -rv obj/

dirs :
	mkdir -p obj/objects/
